package com.jlee.android.pimclient.activity;

import com.jlee.android.pimclient.PIMClientConstant;
import com.jlee.android.pimclient.R;

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class PIMClientStatusActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.status);
		setTitle(R.string.title_status);
		
		initView();
	}

	private void initView() {
		SharedPreferences settings = getSharedPreferences(
				PIMClientConstant.PREFS_NAME, MODE_PRIVATE);
		Boolean assigned = settings.getBoolean(
				PIMClientConstant.PREFS_KEY_ASSIGNED, false);

		ImageView statusIcon = (ImageView) findViewById(R.id.statusIcon);
		TextView statusText = (TextView) findViewById(R.id.statusText);
		Button assignBtn = (Button) findViewById(R.id.assignBtn);
		
		if (assigned) {
			statusIcon.setImageResource(R.drawable.assigned);
			statusText.setText(R.string.status_assigned);
			assignBtn.setText(R.string.button_assign);
		}

	}
}
